#ifndef _COMMONCONSTANT_H_
#define _COMMONCONSTANT_H_

#pragma once
#include <string>

using namespace std;

/* Class name: CommonConstant
 *
 * This class contains common constants or string formats that are commonly used in taskLine
 *
 */
class CommonConstant{
public:
	// temporary character arrays to store strings
	static char buffer[255];
	static char month[10];
	static char day[10];
	static char year[5];
	static char stringPriority[8];

	// common constant/formats used in codes
	static const char END_LINE;										// '\n'
	static const char NULL_CHARACTER;								// '\0'
	static const char WHITE_SPACE;								    // ' '
	static const char COMMAND_SYMBOL;								// '/'
	static const int TRUE;											// 1
	static const int FALSE;											// 0
	static const int INCREMENT;										// 1
	static const int DECREMENT;										// -1
	static const int DEFAULT_VALUE;									// 0
	static const int DEFAULT_TIME_SECONDS;							// 0
	static const int DEFAULT_TIME_MINUTES;							// 0 
	static const int DEFAULT_TIME_HOURS;							// 0
	static const int DEFAULT_END_TIME_SECONDS;						// 59
	static const int DEFAULT_END_TIME_MINUTES;						// 59
	static const int DEFAULT_END_TIME_HOURS;						// 23
	static const int BASE_YEAR;										// 1900
	static const int INDEX_ZERO;									// 0
	static const int MAX_SIZE_24_TIME_STRING_FORMAT;				// 4
	static const int MAX_SIZE_24_TIME_STRING_COMMAND_FORMAT_SEARCH;	// 6
	static const int MAX_SIZE_TIME_STRING_FORMAT;					// 5
	static const int SIZE_DATE_STRING_FORMAT;						// 10
	static const int MAX_SIZE_DATE_STRING_FORMAT;					// 11
	static const int MAX_SIZE_DAY_STRING_FORMAT;					// 10
	static const int MAX_SIZE_MONTH_STRING_FORMAT;					// 5
	static const int MAX_SIZE_YEAR_STRING_FORMAT;					// 1
	static const int TM_MONTH_REFERENCE;							// 1
	static const int TM_SUMMER_TIME_OFF;							// -1
	static const int TM_INITIALIZATION;								// 0
	static const int TM_YEAR_REFERENCE;								// 1900
	static const int MAX_LENGTH_TIME_FORMAT_1;						// 4
	static const time_t INFINITE_TIME; 
	static const int MAX_LENGTH_TIME_FORMAT_2;						// 7
	static const int MONTH_STRING_MAX_LENGTH;
	static const int AMORPM_STRING_MAX_LENGTH;
	static const int HISTORY_EMPTY_SIZE;
	static const int STOI_BASE;										// 10;
	static const string EMPTY_STRING;								// ""
	static const string FULL_DATE_INFO;								// "%s, %s %s %s"
	static const string TIME_24H_STRING_FORMAT;						// "%H%M"
	static const string DATE_STRING_FORMAT;							// "%d/%m/%Y
	static const string DAY_STRING_FORMAT;							// "%A"
	static const string MONTH_STRING_FORMAT;						// "%B"
	static const string YEAR_STRING_FORMAT;							// "%Y"

	// constant strings command
	static const string COMMAND_CREATE;								// "create"
	static const string COMMAND_DISPLAY;							// "display"
	static const string COMMAND_UPDATE;								// "update"
	static const string COMMAND_DELETE;								// "delete"
	static const string COMMAND_SEARCH;								// "search"
	static const string COMMAND_UNDO;								// "undo"
	static const string COMMAND_REDO;								// "redo"
	static const string COMMAND_EXIT;								// "exit"

	// string message displayed to the user
	static const string MESSAGE_CREATED;							// "task successfully added/created"
	static const string MESSAGE_DELETED;							// "task %d has been deleted"
	static const string MESSAGE_INVALID_INDEX;						// "error: invalid index entered"
	static const string MESSAGE_VALID_INDEX_FORMAT;					// "error: invalid index entered"
	static const string MESSAGE_NO_TASK;							// 
	static const string MESSAGE_UPDATED;							// 
	static const string MESSAGE_INSERTED;							// 
	static const string MESSAGE_EMPTY_FILE;							// "empty file"
	static const string MESSAGE_EXIT;								// "See You Again"
	static const string MESSAGE_INVALID_COMMAND;					//
	static const string MESSAGE_UNSUCCESSFUL_FILE_UPDATE;			//
	static const string MESSAGE_WORD_NOT_FOUND;						//
	static const string MESSAGE_NO_USER_INPUT_AFTER_COMMAND;		//
	static const string MESSAGE_INTEGER_VALUES_ONLY;	
	static const string MESSAGE_NO_USER_INPUT_AFTER_COMMAND_UPDATE;
	static const string MESSAGE_INDEX_OUT_OF_RANGE;					//
	static const string MESSAGE_INVALID_FORMAT;						//
	static const string MESSAGE_DELETE_UNDO_SUCCESSFULLY;			//
	static const string MESSAGE_UPDATE_UNDO_SUCCESSFULLY;			//
	static const string WELCOME_MESSAGE_LOADED_EXISTING_FILE;		//
	static const string WELCOME_MESSAGE_NEW_FILE;					//
	static const string WELCOME_MESSAGE_FILE_ERROR;					//
	static const string MESSAGE_INVALID_TIME_FORMAT;				//
	static const string MESSAGE_INVALID_PRIORITY_FORMAT;			//
	static const string MESSAGE_INVALID_STATUS_FORMAT;				//
	static const string MESSAGE_INVALID_START_TIME;					//
	static const string MESSAGE_INVALID_END_TIME;					//
	static const string MESSAGE_NO_REDOABLE_TASK;					// "No redoable task."
	static const string MESSAGE_NO_UNDOABLE_TASK;					// "No undoable task."

	// common constant for task attributes
	static const char TASK_TYPE_FLOATING;							// 'f'
	static const char TASK_TYPE_DEADLINE;							// 'd'
	static const char TASK_TYPE_TIMED;								// 't'
	static const char TASK_TYPE_INVALID;							// 'X'
	static const int TASK_INT_PRIORITY_HIGH;						// 0
	static const int TASK_INT_PRIORITY_MEDIUM;						// 1
	static const int TASK_INT_PRIORITY_LOW;							// 2
	static const int TASK_INT_STATUS_NOT_FINISHED;					// 0
	static const int TASK_INT_STATUS_FINISHED;						// 1
	static const int TASK_INT_INVALID;								// -1
	static const int DISPLAY_PRIORITY_SIZE;							// 8
	static const string TASK_ATTRIBUTE_INVALID;						// "INVALID
	static const string TASK_TITLE_UNTITLED;						// "no title"
	static const string TASK_STRING_PRIORITY_HIGH;					// "HIGH"
	static const string TASK_STRING_PRIORITY_MEDIUM;				// "MEDIUM"
	static const string TASK_STRING_PRIORITY_LOW;					// "LOW"
	static const string TASK_STRING_NUM_PRIORITY_HIGH;				// "0"
	static const string TASK_STRING_NUM_PRIORITY_MEDIUM;			// "1"
	static const string TASK_STRING_NUM_PRIORITY_LOW;				// "2"
	static const string TASK_STRING_STATUS_FINISHED;				// "FINSIHED"
	static const string TASK_STRING_STATUS_NOT_FINISHED;			// "NOT FINSIHED"
	static const string FLOATING_TASK_STRING_FORMAT;                // "
	static const string DEADLINE_TASK_STRING_FORMAT;				// "
	static const string TIMED_TASK_STRING_FORMAT;					// "
	static const string PATTERN;									// "----------------------"

	// common constant for attribute type
	static const string KEYWORD_TASK_ALL;
	static const string KEYWORD_TASK_TITLE;
	static const string KEYWORD_TASK_DESCRIPTION;
	static const string KEYWORD_TASK_PERSON;
	static const string KEYWORD_TASK_LOCATION;
	static const string KEYWORD_TASK_DATE;
	static const string KEYWORD_TASK_START_TIME;
	static const string KEYWORD_TASK_END_TIME;
	static const string KEYWORD_TASK_START_DATE;
	static const string KEYWORD_TASK_END_DATE;
	static const string KEYWORD_TASK_PRIORITY;
	static const string KEYWORD_TASK_FINISHED_STATUS;
    static const string KEYWORD_SEARCH_AVAILABILITY;
	static const string KEYWORD_SYSTEM_START_TIME;
	static const string KEYWORD_SEARCH_TIME;
	static const string KEYWORD_END_TIME;
	static const string KEYWORD_SEARCH_DEFAULT;
	static const string KEYWORD_SEARCH_DATE;

	// common date constants
	static const string DATE_NEXT;
	static const int DATE_ADD_DAY;
	static const int DATE_SUBTRACT_DAY;
	static const int DATE_ADD_HOUR;

	static const string TIME_AM;
	static const string TIME_A;
	static const string TIME_PM;
	static const string TIME_P;
	static const int TIME_TWELVE;
	static const char* TIME_AM_CHAR;
	static const char* TIME_PM_CHAR;
	
	static const int MONTH_JAN;
	static const int MONTH_FEB;
	static const int MONTH_MAR;
	static const int MONTH_APR;
	static const int MONTH_MAY;
	static const int MONTH_JUN;
	static const int MONTH_JUL;
	static const int MONTH_AUG;
	static const int MONTH_SEP;
	static const int MONTH_OCT;
	static const int MONTH_NOV;
	static const int MONTH_DEC;

	static const char* MONTH_JAN_SHORT_CHAR;
	static const char* MONTH_JAN_LONG_CHAR;
	static const char* MONTH_FEB_SHORT_CHAR;
	static const char* MONTH_FEB_LONG_CHAR;
	static const char* MONTH_MAR_SHORT_CHAR;
	static const char* MONTH_MAR_LONG_CHAR;
	static const char* MONTH_APR_SHORT_CHAR;
	static const char* MONTH_APR_LONG_CHAR;
	static const char* MONTH_MAY_SHORT_CHAR;
	static const char* MONTH_MAY_LONG_CHAR;
	static const char* MONTH_JUN_SHORT_CHAR;
	static const char* MONTH_JUN_LONG_CHAR;
	static const char* MONTH_JUL_SHORT_CHAR;
	static const char* MONTH_JUL_LONG_CHAR;
	static const char* MONTH_AUG_SHORT_CHAR;
	static const char* MONTH_AUG_LONG_CHAR;
	static const char* MONTH_SEP_SHORT_CHAR;
	static const char* MONTH_SEP_LONG_CHAR;
	static const char* MONTH_OCT_SHORT_CHAR;
	static const char* MONTH_OCT_LONG_CHAR;
	static const char* MONTH_NOV_SHORT_CHAR;
	static const char* MONTH_NOV_LONG_CHAR;
	static const char* MONTH_DEC_SHORT_CHAR;
	static const char* MONTH_DEC_LONG_CHAR;

	static const int DATE_MAX_DAY_WEEK;
	static const int DATE_MAX_DAY_MONTH;
	static const int DATE_MAX_MONTH_YEAR;
	static const int MAX_SECONDS_DAY;

	static const int DATE_FEBRUARY_MONTH;
	static const int DATE_JUNE_MONTH;
	static const int DATE_SEPTEMBER_MONTH;
	static const int DATE_NOVEMBER_MONTH;
	static const int DATE_FEBRUARY_LEAP_YEAR_DAYS;
	static const int DATE_LEAP_YEAR;
	static const int DATE_CENTURY;
	static const int DATE_LEAP_YEAR_CENTURY;
	static const int DATE_DAYS_MONTH_LIMIT;
	static const int DATE_THIRTY;
	static const int SECONDS_PER_HOUR;  //3600
	static const int AM_PM_CONVERTION;   //12
	static const int NOON;  //12
	static const int MAX_HOUR;    //23
	static const int MIN_HOUR;    //0
	static const int MAX_MINUTE;  //59
	static const int MIN_MINUTE;  //0
	static const int MIN_HOUR_AM;  //0
	static const int MAX_HOUR_AM;  //11
	static const int MIN_HOUR_PM;  //1
	static const int MAX_HOUR_PM;  //12
};

#endif